﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using GH.BLL;

namespace GH.Web.VipManage
{
    public partial class VipMemberSearchPrint : GH.Web.BasePage.PageBase
    {
        #region 画面初始化

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string strWhere = Request.QueryString["strWhere"].ToString();

                SetDataInit(strWhere);
            }

        }



        private void SetDataInit(string strWhere)
        {
            VipMember bllVip = new VipMember();
            DataTable dtQuery = bllVip.GetListByWhere(strWhere).Tables[0];

            rptList.DataSource = dtQuery;
            rptList.DataBind();

        }



        public string GetUnitName(object o)
        {
            if (Convert.ToInt32(o) == -1) {
                return "";
            }
            GH.BLL.Union unitBLL = new Union();
            return unitBLL.GetModel(Convert.ToInt32(o)).单位名称;
        }

        public string GetDepartmentName(object o)
        {
            if (Convert.ToInt32(o) == -1)
            {
                return "";
            }
            GH.BLL.DepartMent DepartMentBLL = new DepartMent();
            return DepartMentBLL.GetModel(Convert.ToInt32(o)).部门名称;
        }

        public string GetGroupName(object o)
        {
            if (Convert.ToInt32(o) == -1)
            {
                return "";
            }
            GH.BLL.Group GroupBLL = new Group();
            return GroupBLL.GetModel(Convert.ToInt32(o)).班组名称;
        }

        public string GetAttrName(object o)
        {
            GH.BLL.User UserLL = new User();
            return UserLL.GetModel("104", o.ToString()).Tables[0].Rows[0]["区分名称"].ToString();
        }
        public string GetEducationName(object o)
        {
            GH.BLL.User UserLL = new User();
            return UserLL.GetModel("101", o.ToString()).Tables[0].Rows[0]["区分名称"].ToString();
        }
        public string GetPoliticalName(object o)
        {
            GH.BLL.User UserLL = new User();
            return UserLL.GetModel("102", o.ToString()).Tables[0].Rows[0]["区分名称"].ToString();
        }
        public string GetTitleName(object o)
        {
            GH.BLL.User UserLL = new User();
            return UserLL.GetModel("103", o.ToString()).Tables[0].Rows[0]["区分名称"].ToString();
        }


        #endregion
    }
}
